<header class="navbar navbar-expand-md navbar-light d-print-none" >
	<div class="container-fluid">
        {% if sidebar == 1  %}
            <button class="navbar-toggler" type="button" data-bs-toggle="offcanvas" data-bs-target="#sidebar" aria-controls="sidebar" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
        {% endif %}

		<h1 class="navbar-brand navbar-brand-autodark d-none-navbar-horizontal pe-0 pe-md-3">
			<a href="/">
				<img src="{{ assets("/images/logo.png") }}" width="110" height="32" alt="eduxplus" class="navbar-brand-image">
			</a>
		</h1>
		<div class="navbar-nav flex-row order-md-last">
			<div class="nav-item d-none d-md-flex me-3">
				<div class="my-2 my-md-0 flex-grow-1 flex-md-grow-0 order-first order-md-last">
					<form action="{{ path('app_search') }}" method="get" autocomplete="off" novalidate="">
						<div class="input-icon">
							<span class="input-icon-addon">
								<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewbox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
									<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
									<path d="M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"></path>
									<path d="M21 21l-6 -6"></path>
								</svg>
							</span>
							<input type="text" autocomplete="off" value="{{ kw }}" class="form-control" name="kw" placeholder="请输入关键字搜索">
						</div>
					</form>
				</div>
			</div>
			<div class="d-none d-md-flex">
				<div class="nav-item dropdown d-none d-md-flex me-3">
					<a href="#" class="nav-link px-0" data-bs-toggle="dropdown" tabindex="-1" aria-label="Show notifications">
						<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewbox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 5a2 2 0 0 1 4 0a7 7 0 0 1 4 6v3a4 4 0 0 0 2 3h-16a4 4 0 0 0 2 -3v-3a7 7 0 0 1 4 -6"/><path d="M9 17v1a3 3 0 0 0 6 0v-1"/></svg>
						{% if msgUnreadCount>0 %}
							<span class="badge bg-red"></span>
						{% endif %}
					</a>
					<div class="dropdown-menu dropdown-menu-arrow dropdown-menu-end dropdown-menu-card">

						<div class="card">
							<div class="card-header">
								<h3 class="card-title">最新消息</h3>
							</div>
							<div class="list-group list-group-flush list-group-hoverable">
								{% if msgUnreadCount>0 %}
									<div class="list-group-item">
										<div class="row align-items-center">
											<div class="col-auto">
												<span class="status-dot d-block"></span>
											</div>
											<div class="col text-truncate">
												<a href="#" class="text-body d-block">Example 2</a>
												<div class="d-block text-muted text-truncate mt-n1"></div>
											</div>
											<div class="col-auto">
												<a href="#" class="list-group-item-actions show">
													<svg xmlns="http://www.w3.org/2000/svg" class="icon text-yellow" width="24" height="24" viewbox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z"/></svg>
												</a>
											</div>
										</div>
									</div>
								{% else %}
									<div class="list-group-item">
										<div class="row align-items-center">
											<div class="col-auto empty">
												当前没有消息
											</div>
										</div>
									</div>
								{% endif %}
							</div>
						</div>
					</div>

				</div>
			</div>
			{% if userinfo %}
				<div class="nav-item dropdown">
					<a href="{{ path('app_user_home') }}" class="nav-link d-flex lh-1 text-reset p-0" data-bs-toggle="dropdown" aria-label="Open user menu">
						<span class="avatar avatar-sm" style="background-image: url({{ assets("/images/gravatar.jpeg") }})"></span>
						<div class="d-none d-xl-block ps-2">
							<div>{{ userinfo.displayName }}</div>
							<div class="mt-1 small text-muted">{{ userinfo.sno }}</div>
						</div>
					</a>
					<div class="dropdown-menu dropdown-menu-end dropdown-menu-arrow">
						<a href="{{ path('app_user_home') }}" class="dropdown-item">个人主页</a>
						<a href="{{ path('app_logout') }}" class="dropdown-item">退出</a>
					</div>
				</div>
			{% else %}
				<div class="nav-item">
					<a href="javascript:;" class="btn" data-bs-toggle="modal" data-bs-target="#modal-login">登录/注册</a>
				</div>
			{% endif %}
		</div>
		<div class="offcanvas-lg offcanvas-end flex-grow-1 d-flex justify-content-center" tabindex="-1" id="bdNavbar" aria-labelledby="bdNavbarOffcanvasLabel" data-bs-scroll="true">
			<div class="offcanvas-header px-4 pb-0">
				<h5 class="offcanvas-title" id="bdNavbarOffcanvasLabel">
					<a href="/">
						<img src="{{ assets("/images/logo.png") }}" width="110" height="32" alt="eduxplus" class="navbar-brand-image">
					</a>
				</h5>
				<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close" data-bs-target="#bdNavbar"></button>
			</div>
			<div class="offcanvas-body p-4 pt-0 p-lg-0">
				{# <div class="d-flex flex-column flex-md-row flex-fill align-items-stretch align-items-md-center"> #}
				<ul class="navbar-nav flex-row flex-wrap bd-navbar-nav">
					<li class="nav-item col-6 col-lg-auto {% if route is defined and route == 'app_index' %} active {% endif %} ">
						<a class="nav-link" href="/">
							<span class="nav-link-icon d-md-none d-lg-inline-block">
								<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewbox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><polyline points="5 12 3 12 12 3 21 12 19 12"/><path d="M5 12v7a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-7"/><path d="M9 21v-6a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v6"/></svg>
							</span>
							<span class="nav-link-title">
								首页
							</span>
						</a>
					</li>
					<li class="nav-item col-6 col-lg-auto {% if route is defined and route == 'app_news' %} active {% endif %}">
						<a class="nav-link" href="{{ path('app_news') }}">
							<span class="nav-link-icon d-md-none d-lg-inline-block">
								<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-news" width="24" height="24" viewbox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
									<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
									<path d="M16 6h3a1 1 0 0 1 1 1v11a2 2 0 0 1 -4 0v-13a1 1 0 0 0 -1 -1h-10a1 1 0 0 0 -1 1v12a3 3 0 0 0 3 3h11"></path>
									<path d="M8 8l4 0"></path>
									<path d="M8 12l4 0"></path>
									<path d="M8 16l4 0"></path>
								</svg>
							</span>
							<span class="nav-link-title">
								文章
							</span>
						</a>
					</li>
					<li class="nav-item col-6 col-lg-auto {% if route is defined and route == 'app_tutorial' %} active {% endif %}">
						<a class="nav-link" href="{{ path('app_tutorial') }}">
							<span class="nav-link-icon d-md-none d-lg-inline-block">
								<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-books" width="24" height="24" viewbox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
									<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
									<path d="M5 4m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v14a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"></path>
									<path d="M9 4m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v14a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"></path>
									<path d="M5 8h4"></path>
									<path d="M9 16h4"></path>
									<path d="M13.803 4.56l2.184 -.53c.562 -.135 1.133 .19 1.282 .732l3.695 13.418a1.02 1.02 0 0 1 -.634 1.219l-.133 .041l-2.184 .53c-.562 .135 -1.133 -.19 -1.282 -.732l-3.695 -13.418a1.02 1.02 0 0 1 .634 -1.219l.133 -.041z"></path>
									<path d="M14 9l4 -1"></path>
									<path d="M16 16l3.923 -.98"></path>
								</svg>
							</span>
							<span class="nav-link-title">
								教程
							</span>
						</a>
					</li>
					<li class="nav-item col-6 col-lg-auto {% if route is defined and route == 'app_course' %} active {% endif %}">
						<a class="nav-link" href="{{ path('app_course') }}">
							<span class="nav-link-icon d-md-none d-lg-inline-block">
								<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-brand-youtube" width="24" height="24" viewbox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
									<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
									<path d="M3 5m0 4a4 4 0 0 1 4 -4h10a4 4 0 0 1 4 4v6a4 4 0 0 1 -4 4h-10a4 4 0 0 1 -4 -4z"></path>
									<path d="M10 9l5 3l-5 3z"></path>
								</svg>
							</span>
							<span class="nav-link-title">
								课程
							</span>
						</a>
					</li>
				</ul>
				{# </div> #}

			</div>
		</div>
		<button class="navbar-toggler" type="button" data-bs-toggle="offcanvas" data-bs-target="#bdNavbar" aria-controls="bdNavbar" aria-label="Toggle navigation">
			<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-antenna-bars-1" width="24" height="24" viewbox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
				<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
				<path d="M6 18l0 .01"></path>
				<path d="M10 18l0 .01"></path>
				<path d="M14 18l0 .01"></path>
				<path d="M18 18l0 .01"></path>
			</svg>
			<span class="d-none fs-6 pe-1">Browse</span>
		</button>
	</div>
</header>
<button class="go-to-top go-to-top-visible" aria-label="Go to top">
	<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-chevron-up icon" width="24" height="24" viewbox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
		<polyline points="6 15 12 9 18 15"></polyline>
	</svg>
</button>


{% if userinfo is not empty %}
{% else %}
<div class="modal modal-blur fade" id="modal-login" tabindex="-1" tabindex="-1" role="dialog" aria-hidden="true">
	<div class="modal-dialog modal-dialog-centered modal-sm" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<h5 class="modal-title">登录/注册</h5>
				<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
			</div>
			<div class="modal-body">
				<form class="ajaxform form" action="{{ path('app_logindo') }}" method="post">
					<div class="mb-3 row">
						<div class="col">
							<input type="mobile" name="mobile" data-required="true" id="smsmobile" value="{{ mobile }}" class="form-control" placeholder="请输入手机号码">
						</div>
					</div>
					<div class="mb-3 row">
						<div class="col-6">
							<input type="text" name="code" value="" data-required="true" placeholder="请输入短信验证码" autocomplete="off" class="form-control">
						</div>
						<div class="col">
							<a class="btn btn-primary" id="smssend">点击发送验证码</a>
						</div>
					</div>
					<div class="mb-3 row">
						<div class="col-12" style="text-align:center">提交表示同意
							<a href="#">《用户协议》</a>
						</div>
						<div class="col-12">
							<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
							<input type="hidden" name="goto" value="{{ goto }}">
							<input type="hidden" id="remember" name="_remember_me" value="0">
							<button class="btn  btn-primary" type="submit">提交</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>

<!-- 短信验证码弹框 -->
<form class="ajaxsmsform modal modal-blur fade" id="sms_model" method="post" action="{{ path('app_glob_sendCaptcha') }}" tabindex="-1" role="dialog" aria-hidden="true">
	<div class="modal-dialog modal-dialog-centered modal-sm" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<h5 class="modal-title">请填写图形验证码后获取短信验证码</h5>
				<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
			</div>
			<div class="modal-body">
				<div class="mb-3 row">
					<div class="col-6">
						<input class="form-control" data-required="true" type="text" name="imgCode" placeholder="图片验证码">
					</div>
					<div class="col">
						<img src="{{ path('app_glob_recaptcha', {type:'siteSmsLogin'}) }}" id="recaptcha_sms_login" alt="点击图片更换验证码">
					</div>
				</div>
				<div class="mb-3 row">
					<div class="col-12">
						<input type="hidden" name="mobile" value="" id="mobilesend">
						<input type="hidden" name="type" value="siteSmsLogin">
						<button type="submit" class="btn  btn-primary">免费获取短信验证码</button>
					</div>
				</div>
			</div>
		</div>
	</div>
</form>
{% endif %}
